<template>
  <div class="use-vmodel">
    <span>使用一个计算器Count.vue组件</span>
    <h2>Count值在父组件的值 {{ num }}</h2>
    <Count v-model:num="num"></Count>
  </div>
</template>

<script>
import Count from "./Count.vue";
import {ref} from "vue";
import {useIntervalFn} from '@vueuse/core'


export default {
  name: "useVModel",
  components: {
    Count
  },
  setup() {
    const num = ref(12)

    const Pausable = useIntervalFn(() => {
      /* your function */
      console.log(1)
    }, 5000, {immediate: false})


    console.log(Pausable)
    return {
      num
    }
  }
}
</script>
